import getpass
import praw
USER_AGENT = 'completly_normal_user' #lol
usr = praw.Reddit(user_agent=USER_AGENT)
def login():
    global user_name
    user_name = input('Username: ')
    user_password = getpass.getpass()
    try:
        print('Loging In...')
        usr.login(username=user_name,password=user_password)
        print('Logged In.')
        return 0
    except Exception:
        print("Error Logging in. check username and password")
        return 1
def Downvote(userN):
    usr2 = usr.get_redditor(userN)
    print('Raiding ',userN,'.')
    limit= int(input('How many Comments? (10 recom..: )'))
    print('Requesting user comments....')
    generator = usr2.get_comments(sort='new',time='all',limit=limit)
    print('Down-voting user comments....')
    for comment in generator:
        print('Down-voting Comment [  ',comment,'  ] .')
        comment.downvote() #call upvote() on comment to upvote
        print('Done.')

print('Reddit Down-vote Bot v1')
print('RedditBot.codeplex.com')
#open to anyone
print('---Reddit Login----')
while login():
    break
userN = input('Who do you want to Down-vote? ')
Downvote(userN)
